package com.chuan.it_market.service.impl;

import com.chuan.it_market.dao.AddressDao;
import com.chuan.it_market.pojo.entity.Address;
import com.chuan.it_market.service.AddressService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {
    @Resource
    AddressDao addressDao;

    @Override
    public List<Address> selectAddressByUserno(Integer uno) {
        return addressDao.selectByUno(uno);
    }

    @Override
    public int addressInsert(Address address) {
        return addressDao.insertSelective(address);
    }

    @Override
    public int addressDelete(Integer ano) {
        return addressDao.deleteByPrimaryKey(ano);
    }

    @Override
    public int addressUpdate(Address address) {
        return addressDao.updateByPrimaryKeySelective(address);
    }

    @Override
    public void morenAddressUpdate(Integer ano) {
        addressDao.updateMorenByPrimaryKey(ano);
    }

    @Override
    public Address selectAddressByAno(Integer ano) {
        return addressDao.selectByPrimaryKey(ano);
    }
}
